package com.exam.service.impl;

import com.exam.dao.AdminMapper;
import com.exam.pojo.Admin;
import com.exam.service.AdminServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminServcie {

    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin findById(int adminid) {
        return adminMapper.selectById(adminid);
    }

    @Override
    public int insertById(Admin admin) {
        return adminMapper.insert(admin);
    }

    @Override
    public int deleteById(int adminid) {
        return adminMapper.deleteById(adminid);
    }

    @Override
    public int updateById(Admin admin) {
        return adminMapper.updateById(admin);
    }

    @Override
    public List<Admin> getAdminAll() {
        return adminMapper.selectList(null);
    }
}
